

import { BaseView } from '../../core/view/base-view';
import { OnInit, Component, Optional } from '@angular/core';


@Component({
  selector: 'bz-column-custom',
  templateUrl: './column-custom.component.html'
})
export class ColumnCustomComponent<U, B, S> extends BaseView<U, B, S> implements OnInit {

  public list = [];
  public dataGridName: string;

  ngOnInit(): void {

  }

  onOk() {
    this._setColumn(this.list.filter(col => col.checked).map(col => col.key));
  }

  onReset() {
    this._setColumn(this.list.map(col => col.key));
  }

  isDisabled() {
    return this.list.every(i => !i.checked);
  }

  _setColumn(showCols: string[]) {
    throw new Error('this method must cover by compoent creator');
  }
}






